/* authoring.css - reusable course authoring UI (Authoring.courseEditor etc.). Mobile first. */
.au-editor { min-width: 0; }
.au-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.au-head h3 { margin: 0 0 2px; } .au-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.au-back { display: inline-flex; align-items: center; gap: 2px; font-size: .88rem; font-weight: 600; text-decoration: none; margin-bottom: 4px; }
.au-cover { display: block; width: 100%; max-width: 360px; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--r); border: 1px solid var(--line); background: var(--sand); }
.au-cover.none { display: grid; place-items: center; color: var(--muted); font-size: .9rem; }
.au-savebar { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding-bottom: 8px; }
.au-sec { border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); }
.au-sec > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; color: var(--navy); } .au-sec-body { padding: 0 16px 16px; }
.mono, textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; }
.ml { margin-left: 8px; }
.tabs-wrap > .tabs { margin-bottom: 16px; }

/* lessons list */
.les-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.les-row { display: grid; grid-template-columns: auto auto 1fr; gap: 4px 8px; align-items: center; padding: 8px 8px 8px 4px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }
.les-row.dragging { opacity: .45; } .les-row.drop { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-l); }
.les-row.is-locked { background: #FBF5F4; }
.les-grip { cursor: grab; color: var(--muted); padding: 8px 6px; display: none; touch-action: none; }
.les-n { width: 28px; height: 28px; border-radius: 50%; background: var(--sand); color: var(--navy); font-weight: 700; font-size: .8rem; display: grid; place-items: center; margin-left: 8px; }
.les-main { text-align: left; background: none; border: 0; padding: 4px; cursor: pointer; display: flex; flex-direction: column; min-width: 0; color: inherit; border-radius: 8px; }
.les-main b { color: var(--navy); overflow-wrap: anywhere; } .les-main:hover b { text-decoration: underline; }
.les-badges { grid-column: 3; display: flex; gap: 6px; flex-wrap: wrap; }
.les-act { grid-column: 1 / -1; display: flex; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 4px; }
.les-act .icon-btn { width: 40px; height: 40px; }
.les-act .icon-btn[disabled] { opacity: .3; }
@media (min-width: 900px) {
  .les-grip { display: block; }
  .les-row { grid-template-columns: auto auto 1fr auto auto; }
  .les-badges { grid-column: auto; } .les-act { grid-column: auto; border: 0; padding: 0; }
}

/* body editor */
.be { border: 1px solid var(--line-2); border-radius: var(--r); background: var(--paper); overflow: hidden; }
.be-bar { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 6px 8px; background: var(--ivory); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.be-tools { display: flex; gap: 4px; flex-wrap: wrap; }
.be-tool { min-height: 34px; padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--paper); color: var(--navy); font-size: .82rem; font-weight: 600; cursor: pointer; width: auto; }
.be-tool:hover { border-color: var(--navy); }
select.be-tool { padding-right: 24px; }
.be-ta { display: block; width: 100%; border: 0; border-radius: 0; padding: 12px; min-height: 280px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; line-height: 1.5; resize: vertical; }
.be-ta:focus { outline: none; box-shadow: inset 0 0 0 2px var(--teal); }
.be-prev { display: block; width: 100%; height: 420px; border: 0; background: #fff; } .be-prev[hidden] { display: none; }

/* question editor */
.qe { display: grid; gap: 12px; }
.qe-opts { display: grid; gap: 8px; }
.qe-opt { display: grid; grid-template-columns: 40px 1fr 40px; gap: 4px; align-items: center; }
.qe-ok { display: grid; place-items: center; height: 44px; cursor: pointer; } .qe-ok input { width: 22px; height: 22px; accent-color: var(--teal); }
.qe-del { width: 40px; height: 40px; } .qe-del[disabled] { opacity: .3; }
.qz-list { display: grid; gap: 16px; }
.qz-item { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; background: #FDFCF9; }
.qz-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.qr-list { display: grid; gap: 8px; max-height: 50vh; overflow: auto; }
.qr-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.qr-item input { margin-top: 4px; width: 20px; height: 20px; flex: none; accent-color: var(--teal); }

/* tutors / wizard / key-values */
.tt-list { display: grid; gap: 8px; }
.tt-item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.tt-item input { width: 20px; height: 20px; accent-color: var(--teal); flex: none; }
.wz-lessons { display: grid; gap: 10px; }
.wz-lesson { display: grid; grid-template-columns: auto 1fr 64px auto; gap: 8px; align-items: center; }
.wz-fields { display: grid; gap: 6px; min-width: 0; } .wz-min { width: 64px; }
@media (max-width: 480px) { .wz-lesson { grid-template-columns: auto 1fr auto; } .wz-min { grid-column: 2; width: 100%; } }
dl.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 16px; margin-block-end: 0; }
dl.kv dt { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; } dl.kv dd { margin: 2px 0 0; font-weight: 600; color: var(--navy); overflow-wrap: anywhere; }
.be [hidden], .qe [hidden], .field[hidden] { display: none !important; }
