/* Study Quest — lesson.css (V7.8 "The living game", lane K, builder v78-notes): lesson notes in the Nauka's Library
 * (js/ui-lesson.js): the lesson bar under a lesson's header, quick capture, the Cornell page, Turn into cards.
 * Flat colour and a ruled-paper texture (never gradients); the Nauka's own colours (css/books.css --nk-*). */

/* ---- the lesson bar (a lesson's scroll, under its tools) */
.ls-bar { margin: 6px 0 2px; padding: 8px 10px 9px; border: 1px solid var(--nk-rule); border-left: 3px solid #8a6a2f; border-radius: 3px; background: #f8f0dd; }
.ls-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.ls-chas { display: inline-block; padding: 1px 8px; border: 1px solid #8a6a2f; border-radius: 10px; background: #efe0bd; font: 700 11.5px/1.5 var(--nk-ui); letter-spacing: 0.04em; color: #5a4319; cursor: help; }
.ls-date { font: 600 13.5px/1.3 var(--nk-ui); color: var(--nk-ink); font-variant-numeric: tabular-nums; }
.ls-chap { display: inline-flex; align-items: center; gap: 6px; }
.ls-chsel, .ls-intosel, .ls-type { height: 28px; max-width: 260px; padding: 0 6px; border: 1px solid var(--nk-rule); border-radius: 4px; background: #fffaf0; font: 500 13px/1 var(--nk-ui); color: var(--nk-ink); }
.ls-seg .nk-btn { height: 28px; }
.ls-seg .nk-btn.is-on { background: #e6d8b8; color: var(--nk-ink); cursor: default; }
.ls-bar .nk-btn { height: 28px; }

/* ---- quick capture: one line, Enter puts it at the end of the Notes (.ed: the scroll's honest-typing rules) */
.ed.ls-cap { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 0; }
.ls-capin { flex: 1; min-width: 0; height: 32px; resize: none; overflow: hidden; padding: 6px 10px; border: 1px solid #c9b48a; border-radius: 4px;
  background: #fffdf6; font: 15px/1.3 var(--nk-read); color: var(--nk-ink); white-space: nowrap; }
.ls-capin:focus { outline: 2px solid var(--nk-lapis); outline-offset: 0; border-color: var(--nk-lapis); }
.ls-capk { flex: none; }
.ls-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.ls-notice > span { flex: 1 1 260px; }
.ls-notice .nk-btn { height: 26px; }

/* ---- the lesson's pages (the Library's view 'lesson', one sheet across the open book) */
.ls-page { max-width: 1100px; margin: 0 auto; padding: 4px 6px 40px; }
.ls-top { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.ls-crumbs { display: flex; gap: 8px; }
.ls-h2 { margin: 2px 0 0; }
.ls-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ls-link { height: 24px; padding: 0 8px; }
.ls-cplabel { border-bottom: 1px dotted var(--nk-meta); cursor: help; }
.ls-tools { margin-top: 2px; }

/* the Cornell sheet: ruled paper (hard-stop lines: a texture, no gradient of colour), a cue column left of the notes, the summary across the foot */
.ls-sheet { margin-top: 12px; border: 1px solid #cdb98f; border-radius: 2px; background-color: #fffcf3;
  background-image: repeating-linear-gradient(180deg, transparent 0 27px, rgba(120, 150, 190, 0.22) 27px 28px); }
.ls-grid { display: grid; grid-template-columns: minmax(170px, 30%) minmax(0, 1fr); }
.ls-part { padding: 10px 14px 14px; min-height: 120px; cursor: text; }
.ls-cues { border-right: 2px solid #c4573a; background: rgba(239, 224, 189, 0.35); }
.ls-summary { border-top: 2px solid #c4573a; min-height: 90px; }
.ls-extra { border-top: 1px dashed #b9a98a; min-height: 0; }
.ls-ph { margin: 0 0 6px; font: 700 11.5px/1.4 var(--nk-ui); letter-spacing: 0.08em; text-transform: uppercase; color: #8a3a22; }
.ls-empty { margin: 0; font: italic 14px/1.45 var(--nk-read); color: #8a7a5f; }
.ls-line { position: relative; display: flex; gap: 6px; padding: 2px 4px 2px calc(4px + var(--in, 0) * 20px); border-radius: 2px; font: 15.5px/24px var(--nk-read); color: var(--nk-ink); overflow-wrap: anywhere; }
.ls-line:hover { background: rgba(47, 90, 154, 0.07); }
.ls-line.is-blank { height: 12px; padding: 0; }
.ls-line.k-heading { font-weight: 700; }
.ls-line.k-heading.h1 { font-size: 17px; }
.ls-line.k-card, .ls-line.k-child { background: #f3ead6; }
.ls-line.k-card { box-shadow: inset 3px 0 0 #b08a3e; }
.ls-bu { flex: none; min-width: 12px; color: #6b5a40; }
.ls-hl { background: #f2dc8c; color: inherit; padding: 0 2px; border-radius: 2px; }
.ls-gap { padding: 0 3px; border-bottom: 2px solid var(--nk-lapis); color: var(--nk-lapis); }
.ls-ref { color: var(--nk-lapis); text-decoration: underline dotted; }

/* ---- Turn into cards */
.ls-into { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 10px; }
.ls-none { margin-top: 10px; }
.ls-sugg { display: flex; flex-direction: column; gap: 8px; }
.ls-s { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 6px; padding: 9px 10px; border: 1px solid var(--nk-rule); border-radius: 4px; background: #fbf6ea; opacity: 0.72; }
.ls-s.is-on { opacity: 1; background: #fffcf3; border-color: #b9a681; box-shadow: inset 3px 0 0 var(--nk-lapis); }
.ls-s.is-bad { border-color: #b4532a; }
.ls-tick { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin: 5px 0 0; border: 1.5px solid #8f7a5a; border-radius: 3px; background: #fffdf8; cursor: pointer; }
.ls-tick:checked { border-color: #24487e; background: var(--nk-lapis) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23f4ecdb' stroke-width='2.2'/%3E%3C/svg%3E") center / 14px 14px no-repeat; }
.ls-tick:focus-visible { outline: 2px solid var(--nk-lapis); outline-offset: 1px; }
.ls-sb { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ls-shead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ls-why { font: 500 12.5px/1.3 var(--nk-ui); color: var(--nk-meta); }
.ls-dup { padding: 1px 7px; border-radius: 9px; background: #e9dfca; font: 600 11.5px/1.5 var(--nk-ui); color: #6b5a40; }
.ls-sides { display: flex; align-items: flex-start; gap: 8px; }
.ls-front, .ls-back, .ls-items { flex: 1 1 0; min-width: 0; padding: 5px 8px; border: 1px solid var(--nk-rule); border-radius: 3px; background: #fffdf8; font: 15px/1.35 var(--nk-read); color: var(--nk-ink); }
.ls-items { resize: vertical; }
.ls-front:focus, .ls-back:focus, .ls-items:focus { outline: 2px solid var(--nk-lapis); outline-offset: 0; }
.ls-arrow { flex: none; padding-top: 6px; font: 700 14px/1 var(--nk-ui); color: var(--nk-lapis); }
.ls-src { font: 13.5px/1.4 var(--nk-read); color: var(--nk-ink-2); overflow-wrap: anywhere; }
.ls-err { font: 600 12.5px/1.3 var(--nk-ui); color: #9a2f08; }
.ls-err:empty { display: none; }
.ls-acts { margin: 0 0 10px; }
.ls-foot { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--nk-rule); }
.ls-added { background: #dbe6d3; color: #2f5a3a; }
.ls-goback { align-self: flex-start; }

/* one page (a small window): the cue column above the notes */
.nk-layer.is-small .ls-grid { grid-template-columns: minmax(0, 1fr); }
.nk-layer.is-small .ls-cues { border-right: 0; border-bottom: 2px solid #c4573a; }
.nk-layer.is-small .ls-sides { flex-direction: column; align-items: stretch; }

/* V7.24 Cards that work everywhere: the ↵ is a button; 48 px targets on a touch screen */
.ls-capgo { cursor: pointer; font: inherit; }
@media (pointer: coarse) {
  .ls-bar .nk-btn, .ls-acts .nk-btn, .ls-foot .nk-btn, .ls-seg .nk-btn, .ls-notice .nk-btn, .ls-capgo, .ls-goback { min-height: 48px; }
  .ls-tick { width: 28px; height: 28px; }
  .ls-s select, .ls-s input[type="text"] { min-height: 44px; }
}
