/* Lesson builder — Tilda-like canvas. Tokens shared with overlays outside .lb-shell */

.lb-shell,
.lb-drawer,
.lb-modal,
.lb-overlay,
.lb-toast,
.lb-preview {
  --lb-ink:#111827;
  --lb-muted:#6B7280;
  --lb-line:#E5E7EB;
  --lb-accent:#4F46E5;
  --lb-soft:#EEF2FF;
}
.lb-shell { width: 100%; max-width: none; margin: 0; padding: 16px 16px 80px; box-sizing: border-box; min-height: 100vh; }
.lb-shell .sd-layout.lb-tabs-top {
  display: flex; flex-direction: column; align-items: stretch; gap: 16px; margin-top: 8px;
}
.lb-shell .sd-tabs { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); position: static; }
.lb-shell .sd-tab { flex-direction: row; justify-content: center; gap: 6px; padding: 10px 8px; }
.lb-shell .sd-tab.le-tab-off { opacity: 1; }
.lb-shell .sd-panel.is-active { margin: 0; }
.lb-shell .sd-content { gap: 0; }
.cl-media-ph { background:#F3F4F6; border-radius:10px; min-height:120px; display:flex; align-items:center; justify-content:center; color:#9CA3AF; font-size:14px; }
.cl-media-ph--drop { cursor:pointer; border:1px dashed #C7D2FE; color:#4F46E5; text-align:center; padding:16px; }
.lb-file-btn { display:inline-flex; align-items:center; }
.lb-shell .lb-file-btn input[type="file"],
.lb-shell .lb-mat-drop input[type="file"] {
  position:absolute; width:1px; height:1px; opacity:0; overflow:hidden; clip:rect(0,0,0,0); padding:0; border:0;
}
.lb-mat-file-name { font-size:13px; color:#6B7280; }
.lb-shell .sd-tab.le-tab-off.is-active { opacity: 1; }

.lb-top { display:flex; align-items:center; gap:12px; margin-bottom: 8px; }
.lb-top .pv-back { flex-shrink:0; }
.lb-top input.lb-title:not([type="checkbox"]):not([type="radio"]) {
  font-size:22px; font-weight:700; letter-spacing:-.01em; line-height:1.25;
  border:none; background:transparent; flex:1; min-width:0; width:auto; font-family:inherit;
  color:var(--lb-ink); padding:0; margin:0; border-radius:0;
}
.lb-title:focus { outline:none; box-shadow: 0 1px 0 var(--lb-accent); }
.lb-aside { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.lb-save {
  position:fixed; top:168px; right:16px; z-index:40;
  font-size:12.5px; color:var(--lb-muted); white-space:nowrap;
  background:#fff; border:1px solid var(--lb-line); border-radius:999px;
  padding:6px 12px; pointer-events:none;
}
.lb-save.is-ok { color:#059669; }
.lb-btn { border:none; border-radius:999px; padding:8px 14px; font-size:13px; font-weight:600; cursor:pointer; font-family:inherit; }
.lb-btn-primary { background:var(--lb-accent); color:#fff; }
.lb-btn-ghost { background:#fff; border:1px solid var(--lb-line); color:#374151; }
.lb-status { font-size:12.5px; color:var(--lb-muted); margin: 4px 0 12px; }
.lb-status.is-draft { color:#B45309; }
.lb-status.is-on { color:#059669; }
.lb-hint { font-size:12.5px; color:#92400E; background:#FFFBEB; border:1px solid #FDE68A; border-radius:10px; padding:8px 12px; margin-bottom:12px; }

.lb-canvas { width:100%; max-width:767px; margin: 0; min-height: 40vh; background:#F5F3EE; padding:24px 20px 16px; border-radius:16px; box-sizing:border-box; margin: 0 auto;}
.lb-zone { width:100%; max-width:767px; margin: 0 auto 28px; }
.lb-zone-h { font-size:13px; font-weight:700; color:#6B7280; letter-spacing:.04em; text-transform:uppercase; margin: 0 0 8px; }
.lb-zone-meta { display:flex; gap:16px; flex-wrap:wrap; margin: 0 0 8px; }
.lb-zone-meta label { font-size:12px; color:#6B7280; display:flex; flex-direction:column; gap:4px; }
.lb-zone-meta input { width:96px; border:1px solid var(--lb-line); border-radius:8px; padding:6px 8px; font-size:14px; font-family:inherit; }
.lb-zone .lb-canvas { min-height: 80px; padding-top: 16px; }
.lb-materials { padding-bottom: 32px; }
.lb-materials-lead { font-size:13px; color:var(--lb-muted); margin: 0 0 4px; }
.lb-materials-empty { font-size:13px; color:#9CA3AF; padding:16px 0; border-bottom:1px solid var(--lb-line); }
.lb-mat-row {
  display:flex; align-items:center; gap:16px;
  padding:14px 0; border-bottom:1px solid var(--lb-line); background:transparent;
}
.lb-mat-main { flex:1; min-width:0; }
.lb-mat-title { font-size:15px; font-weight:600; color:var(--lb-ink); }
.lb-mat-meta { font-size:12px; color:var(--lb-muted); margin-top:2px; white-space:pre-wrap; }
.lb-mat-dl { display:flex; align-items:center; gap:10px; margin:0; flex-shrink:0; }
.lb-mat-dl-label { font-size:13px; color:var(--lb-muted); }
.lb-mat-actions { display:flex; align-items:center; gap:4px; flex-shrink:0; }
.lb-mat-actions form { margin:0; }
.lb-mat-link {
  background:none; border:none; padding:6px 8px; font-size:13px; font-weight:500;
  color:#6B7280; cursor:pointer; font-family:inherit; text-decoration:none; border-radius:6px;
}
.lb-mat-link:hover { color:var(--lb-ink); background:#F3F4F6; }
.lb-mat-link-danger:hover { color:#B91C1C; background:#FEF2F2; }
.lb-mat-form { display:flex; flex-direction:column; gap:12px; margin-top:28px; }
.lb-mat-form-row { display:grid; grid-template-columns:1fr 148px; gap:8px; }
.lb-mat-drop {
  position:relative; display:flex; align-items:center; justify-content:center;
  min-height:72px; border:1px dashed #D1D5DB; border-radius:10px; background:#FAFAF9;
  cursor:pointer; text-align:center; padding:12px;
}
.lb-mat-drop:hover { border-color:#9CA3AF; background:#F9FAFB; }
.lb-mat-drop .lb-mat-file-name { color:#6B7280; }
.lb-mat-form .lb-mat-switch { padding:4px 0 0; border-bottom:none; margin:0; }
.lb-mat-form .lb-btn-primary { align-self:flex-start; }
.lb-mat-drop[hidden], .lb-mat-form [hidden] { display: none !important; }
@media (max-width: 640px) {
  .lb-mat-row { flex-wrap:wrap; gap:8px 12px; }
  .lb-mat-main { flex:1 1 100%; }
  .lb-mat-form-row { grid-template-columns:1fr; }
}
.lb-insert { display:flex; align-items:center; justify-content:center; gap:10px; margin: 4px 0; position:relative; z-index:8; }
.lb-plus { width:28px; height:28px; border-radius:50%; border:1px solid var(--lb-line); background:#fff; cursor:pointer; font-size:18px; line-height:26px; color:var(--lb-accent); }
.lb-plus:hover { background:var(--lb-soft); }

.lb-card { background:transparent; border:1px solid transparent; border-radius:16px; padding: 0; margin: 0 0 4px; position:relative; }
.lb-card:hover { z-index:6; }
.lb-card.is-selected { border-color:var(--lb-accent); box-shadow: 0 0 0 3px rgba(79,70,229,.12); z-index:6; }
.lb-card.is-hidden { opacity:.55; }
.lb-card-head {
  position:absolute; top:4px; left:8px; right:8px;
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  opacity:0; pointer-events:none; z-index:7;
  user-select:none;
}
.lb-card > .lb-insert {
  position:absolute; left:0; right:0; bottom:4px;
  margin:0; z-index:8;
  opacity:0; pointer-events:none;
}
.lb-card:hover:not(:has(.lb-card:hover)) > .lb-card-head,
.lb-card.is-selected > .lb-card-head,
.lb-card:hover:not(:has(.lb-card:hover)) > .lb-insert,
.lb-card.is-selected > .lb-insert { opacity:1; pointer-events:auto; }
.lb-card-preview { pointer-events:none; user-select:none; }
.lb-card-preview.cl-width-full { width:100%; margin-left:0; }
.lb-ctrl-left, .lb-ctrl {
  display:flex; align-items:stretch;
  background:#fff; border:1px solid var(--lb-line); border-radius:8px;
}
.lb-ctrl-left { overflow:hidden; }
.lb-ctrl .lb-menu .lb-icon { border-radius:8px 0 0 8px; }
.lb-ctrl > .lb-icon:last-child { border-radius:0 8px 8px 0; }
.lb-type-chip {
  height:28px; padding:0 10px 0 8px; border:none; background:transparent;
  cursor:default; font-family:inherit; font-size:12px; font-weight:500;
  color:#374151; line-height:28px; white-space:nowrap;
  display:flex; align-items:center; gap:6px;
}
.lb-type-chip svg { width:15px; height:15px; display:block; flex-shrink:0; }
.lb-text-btn {
  height:28px; padding:0 10px 0 8px; border:none; background:transparent;
  cursor:pointer; font-family:inherit; font-size:12px; font-weight:500;
  color:#374151; line-height:28px; white-space:nowrap;
  box-shadow: inset 1px 0 0 var(--lb-line);
  display:flex; align-items:center; gap:6px;
}
.lb-text-btn:hover { background:#F9FAFB; }
.lb-text-btn svg { width:15px; height:15px; display:block; flex-shrink:0; }
.lb-icon {
  width:28px; height:28px; border:none; background:transparent;
  cursor:pointer; font-size:13px; color:#374151;
  display:inline-flex; align-items:center; justify-content:center; padding:0;
}
.lb-ctrl-left .lb-icon { box-shadow: inset 1px 0 0 var(--lb-line); }
.lb-ctrl > .lb-icon { box-shadow: inset 1px 0 0 var(--lb-line); }
.lb-icon:hover { background:#F9FAFB; }
.lb-icon svg { width:15px; height:15px; display:block; }
.lb-menu { position:relative; display:flex; }
.lb-menu-list { display:none; position:absolute; right:0; top:32px; background:#fff; border:1px solid var(--lb-line); border-radius:10px; min-width:200px; z-index:20; padding:6px; box-shadow:0 8px 24px rgba(17,24,39,.12); }
.lb-menu.is-open .lb-menu-list { display:block; }
.lb-card:has(.lb-menu.is-open) { z-index:30; }
.lb-card:has(.lb-menu.is-open) > .lb-card-head {
  opacity:1; pointer-events:auto; z-index:12;
}
.lb-card:has(.lb-menu.is-open) > .lb-insert {
  z-index:1; pointer-events:none;
}
.lb-menu-list button { display:block; width:100%; text-align:left; background:none; border:none; padding:8px 10px; font-size:13px; cursor:pointer; border-radius:8px; font-family:inherit; }
.lb-menu-list button:hover { background:#F3F4F6; }
.lb-menu-list hr { border:none; border-top:1px solid var(--lb-line); margin:4px 0; }
.lb-card-flags { display:flex; gap:6px; padding:4px 4px 10px; }
.lb-hidden-flag { font-size:11px; color:#B45309; background:#FFFBEB; border-radius:6px; padding:2px 6px; }

.lb-drawer {
  position:fixed; top:0; bottom:0; left:0; width:min(360px, 92vw); background:#fff; z-index:80;
  border-right:1px solid var(--lb-line, #E5E7EB);
  display:flex; flex-direction:column; transform:translateX(-110%); transition:transform .2s ease;
}
.lb-drawer.is-open { transform:none; }
.lb-drawer-right { right:0; left:auto; width:min(420px, 94vw); border-right:none; border-left:1px solid var(--lb-line, #E5E7EB); transform:translateX(110%); }
.lb-drawer-right.is-open { transform:none; }
.lb-overlay { display:none; position:fixed; inset:0; background:rgba(17,24,39,.28); z-index:70; }
.lb-overlay.is-open { display:block; }
.lb-drawer-head {
  flex-shrink:0; padding:16px 16px 12px; border-bottom:1px solid var(--lb-line, #E5E7EB);
  display:flex; flex-direction:column; gap:10px; background:#fff;
}
.lb-drawer-head h2 { margin:0; font-size:16px; font-weight:600; letter-spacing:-.01em; color:var(--lb-ink, #111827); }
.lb-drawer-head input.lb-search:not([type="checkbox"]):not([type="radio"]) {
  width:100%; border:1px solid var(--lb-line, #E5E7EB); border-radius:8px; padding:8px 12px;
  font-size:14px; margin:0; box-sizing:border-box; background-color:#F9FAFB; line-height:1.4;
  color:var(--lb-ink, #111827); font-family:inherit;
}
.lb-drawer-head input.lb-search:focus {
  outline:none; background-color:#fff; border-color:var(--lb-accent, #4F46E5);
}
.lb-drawer-head input.lb-search::placeholder { font-size:14px; color:#9CA3AF; }
.lb-drawer-body { overflow:auto; padding:12px 12px 28px; flex:1; }
.lb-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.lb-tile { border:1px solid var(--lb-line, #E5E7EB); border-radius:12px; padding:10px; text-align:left; background:#fff; cursor:pointer; font-family:inherit; color:var(--lb-ink, #111827); }
.lb-tile:hover { border-color:var(--lb-accent, #4F46E5); background:var(--lb-soft, #EEF2FF); }
.lb-tile b { display:block; font-size:13px; margin-bottom:2px; font-weight:600; }
.lb-tile span { font-size:11px; color:var(--lb-muted, #6B7280); }
.lb-mode { margin-top:20px; font-size:13px; font-weight:500; color:var(--lb-muted, #6B7280); background:none; border:none; cursor:pointer; padding:8px 10px; font-family:inherit; }
.lb-mode:hover { background:#F3F4F6; border-radius:8px; color:var(--lb-ink, #111827); }
#lb-palette .lb-mode {
  display:block; width:100%; box-sizing:border-box; text-align:left;
  margin: 8px 0 4px; padding:8px 10px; border-radius:8px;
}
#lb-palette details.lb-cat { display: none; }

#lb-palette .lb-grid {
  display:flex; flex-direction:column; gap:2px;
}
#lb-palette .lb-tile {
  display:flex; align-items:baseline; justify-content:space-between; gap:12px;
  width:100%; box-sizing:border-box;
  border:none; border-radius:8px; padding:9px 10px;
  background:transparent; text-align:left;
  font: inherit; appearance:none; -webkit-appearance:none;
}
#lb-palette .lb-tile:hover { background:#F3F4F6; border:none; }
#lb-palette .lb-tile b { margin:0; font-size:13.5px; font-weight:500; color:var(--lb-ink, #111827); }
#lb-palette .lb-tile span { font-size:12px; color:var(--lb-muted, #6B7280); flex-shrink:0; }
#lb-palette .lb-label {
  font-size:11px; font-weight:600; letter-spacing:.04em; text-transform:uppercase;
  color:#4B5563; margin:0 0 8px;
}
#lb-palette .lb-lib { margin: 0 0 20px; }
#lb-palette .lb-cat[data-cat="simple-wrap"] { margin: 0; }
#lb-palette details.lb-cat {
  margin: 2px 0 0;
  border-radius: 8px;
}
#lb-palette #lb-ex-picker + details.lb-cat { margin-top: 16px; }
#lb-palette .lb-cat-sum {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  list-style: none; cursor: pointer;
  padding: 8px 10px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--lb-muted, #6B7280);
  font-family: inherit; user-select: none;
}
#lb-palette .lb-cat-sum::-webkit-details-marker { display: none; }
#lb-palette .lb-cat-sum::marker { content: none; }
#lb-palette .lb-cat-sum::after {
  content: ""; width: 6px; height: 6px; flex-shrink: 0;
  border-right: 1.5px solid #9CA3AF; border-bottom: 1.5px solid #9CA3AF;
  transform: rotate(-45deg); margin-right: 4px;
}
#lb-palette details.lb-cat[open] > .lb-cat-sum { color: var(--lb-ink, #111827); }
#lb-palette details.lb-cat[open] > .lb-cat-sum::after {
  transform: rotate(45deg); margin-top: -2px;
}
#lb-palette .lb-cat-sum:hover { background: #F3F4F6; color: var(--lb-ink, #111827); }
#lb-palette details.lb-cat .lb-grid { padding: 0 0 6px; }
#lb-ex-picker { margin-top:8px; }

.lb-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  margin: 0 -12px 4px;
  padding: 0 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--lb-line, #E5E7EB);
  scrollbar-width: thin;
}
.lb-tab {
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 12px 9px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--lb-muted, #6B7280);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
.lb-tab:hover { color: var(--lb-ink, #111827); }
.lb-tab.is-on {
  color: var(--lb-ink, #111827);
  font-weight: 600;
  border-bottom-color: var(--lb-ink, #111827);
  background: transparent;
}

.lb-field { margin-bottom:12px; }
.lb-label { display:block; font-size:12px; font-weight:600; color:var(--lb-muted, #6B7280); margin-bottom:4px; }
.lb-shell input.lb-input:not([type="checkbox"]):not([type="radio"]),
.lb-drawer input.lb-input:not([type="checkbox"]):not([type="radio"]),
.lb-modal input.lb-input:not([type="checkbox"]):not([type="radio"]),
.lb-shell textarea.lb-textarea,
.lb-drawer textarea.lb-textarea,
.lb-modal textarea.lb-textarea,
.lb-shell select.lb-select,
.lb-drawer select.lb-select,
.lb-modal select.lb-select {
  width:100%; border:1px solid var(--lb-line); border-radius:8px; padding:8px 12px;
  font-size:14px; box-sizing:border-box; font-family:inherit; background-color:#fff; margin:0;
}
.lb-textarea { min-height:88px; resize:vertical; }
.lb-more { margin-top:16px; border-top:1px solid var(--lb-line); padding-top:10px; }
.lb-more > summary { cursor:pointer; font-size:13px; font-weight:600; color:var(--lb-muted); list-style:none; }
.lb-toast { position:fixed; bottom:24px; left:50%; transform:translateX(-50%); background:#111827; color:#fff; padding:10px 16px; border-radius:10px; font-size:13px; z-index:90; display:none; }
.lb-toast.is-on { display:flex; gap:12px; align-items:center; }
.lb-toast button { background:#fff; color:#111; border:none; border-radius:8px; padding:4px 8px; cursor:pointer; font-weight:600; }

.lb-preview { display:none; position:fixed; inset:0; background:rgba(17,24,39,.5); z-index:100; align-items:center; justify-content:center; }
.lb-preview.is-open { display:flex; }
.lb-preview-box { background:#fff; width:min(1200px, 96vw); height:90vh; border-radius:16px; overflow:hidden; display:flex; flex-direction:column; }
.lb-preview-bar { display:flex; gap:8px; padding:10px 14px; border-bottom:1px solid var(--lb-line); }
.lb-card.is-dragging { opacity:.4; }
.lb-preview-box iframe { flex:1; border:0; width:100%; background:#F5F3EE; display:block; }
.cl-colgrid { display:grid; gap:12px; }
.cl-colgrid.p-50_50 { grid-template-columns:1fr 1fr; }
.cl-colgrid.p-33_33_33 { grid-template-columns:1fr 1fr 1fr; }
.cl-colgrid.p-67_33 { grid-template-columns:2fr 1fr; }
.cl-colgrid.p-33_67 { grid-template-columns:1fr 2fr; }
.cl-colgrid.p-25x4 { grid-template-columns:repeat(4,1fr); }

.lb-scaffold { background:#fff; border-radius:16px; padding:20px; }
.lb-scaffold h3 { margin:0 0 12px; font-size:16px; }
.lb-sc-item { display:block; width:100%; text-align:left; border:1px solid var(--lb-line); background:#fff; border-radius:12px; padding:12px; margin-bottom:8px; cursor:pointer; font-family:inherit; }
.lb-sc-item:hover { border-color:var(--lb-accent); }
.lb-sc-item b { display:block; font-size:14px; }
.lb-sc-item span { font-size:12px; color:var(--lb-muted); }

.lb-children { display:grid; gap:8px; margin-top:8px; padding:8px; background:#F9FAFB; border-radius:10px; }
.lb-colgrid { display:grid; gap:8px; }
.lb-colgrid.p-50_50 { grid-template-columns:1fr 1fr; }
.lb-colgrid.p-33_33_33 { grid-template-columns:1fr 1fr 1fr; }
.lb-colgrid.p-67_33 { grid-template-columns:2fr 1fr; }
.lb-colgrid.p-33_67 { grid-template-columns:1fr 2fr; }
.lb-colgrid.p-25x4 { grid-template-columns:repeat(4,1fr); }
@media (max-width:720px) {
  .lb-colgrid, .cl-colgrid, .cl-compare { grid-template-columns:1fr !important; }
}
@media (max-width:720px), (hover:none) {
  .lb-card { padding-top:44px; }
  .lb-card-head,
  .lb-card > .lb-insert { opacity:1; pointer-events:auto; }
}

/* Landing canvas — Tilda-like page, not a stack of cards */
.cl-shell,
.lc-shell,
.lb-canvas {
  --cl-bg: #F5F3EE;
  --cl-ink: #111111;
  --cl-accent: #4F46E5;
  --cl-accent-soft: #EEF2FF;
  --cl-line: rgba(17, 17, 17, 0.08);
  --cl-paper: transparent;
  font-family: Figtree, ui-sans-serif, system-ui, sans-serif;
}
.cl-shell,
.lc-shell {
  background: var(--cl-bg);
  color: var(--cl-ink);
}
html[data-lesson-theme="dark"] .cl-shell,
html[data-lesson-theme="dark"] .lc-shell {
  --cl-bg: #0B0F19;
  --cl-ink: #F4F4F5;
  --cl-accent: #818CF8;
  --cl-accent-soft: rgba(129, 140, 248, 0.16);
  --cl-line: rgba(255, 255, 255, 0.12);
}
body.theme-night .cl-shell,
body.theme-night .cl-shell :is(h1, h2, h3, h4, h5, h6, p, span, a, label, li, td, th, cite, summary, div, strong, em) {
  color: var(--cl-ink);
}
body.theme-night .cl-shell :is(a, summary) {
  color: var(--cl-accent);
}

.lc-shell {
  min-height: 100vh;
  padding: 28px 28px 96px;
  max-width: 1000px;
  margin: 0 auto;
  box-sizing: border-box;
}
.lc-cover {
  background: transparent;
  border: 0;
  padding: 28px 0 12px;
  margin: 0 0 8px;
}
.lc-title {
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.12;
  color: var(--cl-ink);
}
.lc-meta {
  font-size: 15px;
  font-weight: 600;
  color: var(--cl-accent);
  margin-top: 12px;
  letter-spacing: -.01em;
}
.lc-block {
  position: relative;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
  scroll-margin-top: 24px;
  transition: background .25s, box-shadow .25s;
}
.lc-block.is-focused {
  background: var(--cl-accent-soft);
  border-radius: 16px;
  box-shadow: 0 0 0 12px var(--cl-accent-soft);
}
.lc-tool-dock {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: #fff;
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 2px 8px rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.lc-block:hover .lc-tool-dock,
.lc-block:focus-within .lc-tool-dock {
  opacity: 1;
  pointer-events: auto;
}
.lc-tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #1a1a1a;
  cursor: pointer;
  font-family: inherit;
}
.lc-tool-btn:hover:not(:disabled) {
  background: #f5f5f5;
}
.lc-tool-btn:active:not(:disabled) {
  background: #e8eeff;
  color: #4262ff;
}
.lc-tool-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.lc-focus-btn {
  border: none;
  background: var(--cl-accent-soft);
  color: var(--cl-accent);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}
.lc-focus-btn:hover { filter: brightness(0.96); }
.lc-section-h,
.cl-section-h {
  font-size: 12px;
  font-weight: 700;
  color: var(--cl-accent);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 36px 0 8px;
}
.lc-toast {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: #3730A3;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  z-index: 20;
  display: none;
}
.lc-toast.is-visible { display: block; }
.lc-empty {
  text-align: left;
  padding: 48px 0;
  color: var(--cl-accent);
  font-size: 18px;
  line-height: 1.5;
}
.cl-theme-btn {
  border: 0;
  background: transparent;
  color: var(--cl-accent);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 0;
  white-space: nowrap;
}

.cl-block { background: var(--cl-paper); padding: 0; }
.cl-rule { position:relative; padding-left:12px; }
.cl-rule::before {
  content:""; position:absolute; left:0; top:0; bottom:0; width:3px;
  background: var(--cl-accent, #3730A3); border-radius:0;
}
.cl-block-html { font-size:18px; line-height:1.75; color: var(--cl-ink, #111); }
.cl-block-html a { color: var(--cl-accent, #4F46E5); }
.cl-h1, .cl-h2, .cl-h3 { color: var(--cl-ink, #111); }
.cl-h1 {
  font-size: clamp(32px, 4.4vw, 42px);
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.15;
}
.cl-h2 {
  font-size: clamp(26px, 3.4vw, 32px);
  margin: 0 0 10px;
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.2;
}
.cl-h3 {
  font-size: 22px;
  margin: 0 0 8px;
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.3;
}
.cl-align-left { text-align:left; }
.cl-align-center { text-align:center; }
.cl-align-right { text-align:right; }
.cl-ph { color: var(--cl-accent, #4F46E5); font-weight:400; font-style:normal; }
.cl-callout {
  --co-paper:#E6D6B0;
  --co-ink:#2A2418;
  --co-mark:#7A5A2E;
  position:relative;
  padding:0;
  background:transparent;
}
.cl-callout.warning { --co-paper:#E8B48A; --co-ink:#2C2018; --co-mark:#9A4A28; }
.cl-callout.success { --co-paper:#D2D8B4; --co-ink:#222418; --co-mark:#4E5C32; }
.cl-callout.danger  { --co-paper:#D49C8E; --co-ink:#2A1C18; --co-mark:#8A342C; }
.cl-callout-head {
  display:flex;
  align-items:flex-start;
  gap:8px;
  margin:0 0 12px;
}
.cl-callout-eye {
  width:16px;
  height:16px;
  flex-shrink:0;
  margin-top:1px;
  color:var(--co-mark);
}
.cl-callout-kicker {
  display:block;
  font-family:inherit;
  font-size:11px;
  font-weight:600;
  letter-spacing:.12em;
  text-transform:uppercase;
  line-height:16px;
  color:var(--co-mark);
}
.cl-callout-sheet {
  position:relative;
  overflow:hidden;
  margin-left:24px;
  padding:16px 96px 20px 20px;
  background:var(--co-paper);
  border-radius:8px;
}
.cl-callout-mark {
  position:absolute;
  right:-4px;
  bottom:4px;
  width:72px;
  height:72px;
  color:var(--co-mark);
  opacity:.1;
  pointer-events:none;
  z-index:0;
}
.cl-callout .cl-block-html {
  position:relative;
  z-index:1;
  font-size:16px;
  line-height:1.65;
  color:var(--co-ink);
  max-width:100%;
}
.cl-callout .cl-block-html > *:first-child { margin-top:0; }
.cl-callout .cl-block-html > *:last-child { margin-bottom:0; }
.cl-callout .cl-block-html p { margin:0 0 8px; }
.cl-callout .cl-block-html p:last-child { margin-bottom:0; }
.cl-callout .cl-block-html a { color:var(--co-mark); text-underline-offset:2px; }
.cl-callout .cl-block-html.cl-ph { color:#9A8F7E; }
.cl-vocab-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:12px; }
.cl-vocab-card { border:0; border-radius:12px; padding:16px 16px 18px; background: var(--cl-accent-soft, #F8FAFF); }
.cl-vocab-word { font-size:18px; font-weight:700; color: var(--cl-accent, #4338CA); letter-spacing:-.02em; }
.cl-vocab-translation { font-size:16px; color: var(--cl-ink, #111); margin-top:4px; }
.cl-vocab-example { font-size:14px; color: var(--cl-accent, #4F46E5); margin-top:8px; font-style:italic; }
.cl-rule-title { font-size:20px; font-weight:650; color: var(--cl-ink, #111); line-height:1.3; letter-spacing:-.02em; }
.cl-rule-body { font-size:17px; line-height:1.7; color: var(--cl-ink, #111); margin-top:8px; }
.cl-rule-examples { margin-top:10px; }
.cl-rule-example { margin:0 0 4px; font-size:16px; line-height:1.55; color: var(--cl-ink, #111); }
.cl-rule-exceptions { margin-top:12px; }
.cl-rule-kicker { font-size:12px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color: var(--cl-accent, #4F46E5); margin-bottom:4px; }
.cl-rule-exceptions-body { font-size:16px; line-height:1.6; color: var(--cl-ink, #111); }
.cl-teacher-note { background:#FFFBEB; border-radius:12px; padding:12px 14px; }
.cl-teacher-note-label { font-size:11px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:#B45309; margin-bottom:6px; }
.cl-media-ph { background:#F3F4F6; border-radius:10px; min-height:120px; display:flex; align-items:center; justify-content:center; color:#9CA3AF; font-size:14px; }
.cl-hw-card { background:#FFFBEB; border:1px solid #FDE68A; border-radius:14px; padding:16px; }
.cl-hw-title { font-size:15px; font-weight:700; color:#92400E; margin-bottom:8px; }
.cl-hw-desc { font-size:13px; color:#78350F; }
.cl-resource { display:flex; align-items:center; gap:10px; background:#F0FDF4; border:1px solid #BBF7D0; border-radius:10px; padding:10px 14px; text-decoration:none; }
.cl-resource-name { flex:1; font-size:14px; font-weight:600; color:#374151; }
.cl-caption { font-size:13px; color: var(--cl-accent, #4F46E5); margin-top:8px; text-align:center; font-weight:600; }
details .cl-block-html { margin-top:10px; }
.cl-reveal { margin: 0; }
.cl-reveal > summary {
  cursor: pointer;
  color: var(--cl-accent, #4F46E5);
  font-weight: 650;
  font-size: 17px;
  line-height: 1.45;
  list-style: none;
}
.cl-reveal > summary::-webkit-details-marker { display: none; }
.cl-table-wrap { overflow-x:auto; }
.cl-table { width:100%; border-collapse:collapse; font-size:14px; }
.cl-table th, .cl-table td { border:1px solid #E5E7EB; padding:8px; text-align:left; }
.cl-formula { overflow-x:auto; font-size:18px; padding:8px 0; }
.cl-embed { width:100%; border:0; background:#111; }
.cl-embed-ph {
  min-height: 88px; border-radius: 12px; border: 1px dashed #C7D2FE;
  background: #EEF2FF; color: #4338CA; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; text-align: center; word-break: break-all;
}
.cl-embed-ph.cl-ph { color: #9CA3AF; border-color: #E5E7EB; background: #F9FAFB; }
.cl-media { width:100%; height:auto; border-radius:12px; display:block; background:transparent; }
img.cl-media--fit-height { width:auto; max-width:100%; height:auto; max-height:min(70vh, 640px); margin-left:auto; margin-right:auto; }
.lb-card[data-type="image"] { padding-left:0; padding-right:0; }
.lb-card-preview:has(> img.cl-media),
.cl-block:has(> img.cl-media) {
  background: transparent !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-bottom: 0 !important;
  border-radius: 0 !important;
}
.cl-width-narrow { max-width:520px; margin-left:auto; margin-right:auto; }
.cl-width-wide { max-width:none; }
.cl-width-full { width:100vw; margin-left:calc(50% - 50vw); }
.cl-pad-15 { padding-top:15px; padding-bottom:0; }
.cl-pad-30 { padding-top:30px; padding-bottom:0; }
.cl-pad-45 { padding-top:45px; padding-bottom:0; }
.cl-pad-60 { padding-top:60px; padding-bottom:0; }
.cl-pad-75 { padding-top:75px; padding-bottom:0; }
.cl-pad-90 { padding-top:90px; padding-bottom:0; }
.cl-bg-soft { background:#F8FAFC; }
.cl-bg-accent { background:#EEF2FF; }
html[data-lesson-theme="dark"] .cl-bg-soft { background: rgba(255,255,255,.04); }
html[data-lesson-theme="dark"] .cl-bg-accent { background: var(--cl-accent-soft); }
html[data-lesson-theme="dark"] .cl-table th,
html[data-lesson-theme="dark"] .cl-table td,
html[data-lesson-theme="dark"] .cl-rubric th,
html[data-lesson-theme="dark"] .cl-rubric td {
  border-color: var(--cl-line);
  color: var(--cl-ink);
}
html[data-lesson-theme="dark"] .cl-divider { border-top-color: var(--cl-line); }
html[data-lesson-theme="dark"] .cl-book { background: rgba(255,255,255,.04); }
.cl-quote { margin:0; padding:8px 0; font-size:22px; line-height:1.45; font-style:italic; color: var(--cl-ink, #111); letter-spacing:-.02em; }
.cl-quote p { margin:0; }
.cl-quote cite { display:block; font-size:14px; font-style:normal; font-weight:600; color: var(--cl-accent, #4F46E5); margin-top:10px; }
.cl-check { display:flex; flex-direction:column; gap:8px; }
.cl-check-title { font-size:20px; font-weight:650; margin-bottom:8px; letter-spacing:-.02em; color: var(--cl-ink, #111); }
.cl-check-item { display:flex; align-items:flex-start; gap:10px; font-size:17px; line-height:1.5; cursor:pointer; color: var(--cl-ink, #111); }
.cl-check-item input { width:18px; height:18px; margin-top:2px; flex-shrink:0; accent-color: var(--cl-accent, #4F46E5); }
.cl-steps { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:16px; }
.cl-steps-title, .cl-timeline-title {
  font-size: clamp(26px, 3.4vw, 32px);
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.2;
  margin-bottom: 18px;
  color: var(--cl-ink, #111);
}
.cl-steps li { display:flex; gap:14px; align-items:flex-start; font-size:17px; line-height:1.55; color: var(--cl-ink, #111); }
.cl-steps-num { width:32px; height:32px; border-radius:50%; background: var(--cl-accent-soft, #EEF2FF); color: var(--cl-accent, #4338CA); font-size:14px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.cl-timeline { list-style:none; margin:0; padding:0 0 0 18px; border-left:2px solid var(--cl-accent, #4F46E5); }
.cl-timeline li { position:relative; padding:0 0 22px 20px; }
.cl-timeline li:last-child { padding-bottom:0; }
.cl-timeline li::before { content:''; position:absolute; left:-22px; top:8px; width:10px; height:10px; border-radius:50%; background: var(--cl-accent, #4F46E5); }
.cl-timeline-year { display:block; font-size:13px; font-weight:700; color: var(--cl-accent, #4F46E5); letter-spacing:.04em; margin-bottom:4px; }
.cl-timeline-text { font-size:17px; line-height:1.55; color: var(--cl-ink, #111); }
.cl-rubric { width:100%; border-collapse:collapse; font-size:14px; }
.cl-rubric th, .cl-rubric td { text-align:left; padding:8px 10px; border-bottom:1px solid #E5E7EB; }
.cl-rubric th { font-size:12px; color: var(--cl-accent, #4F46E5); font-weight:600; }
.cl-table-caption { font-size:13px; color: var(--cl-accent, #4F46E5); margin-bottom:6px; font-weight:600; }
.cl-code { overflow-x:auto; background:#111827; color:#F9FAFB; padding:12px; border-radius:10px; font-size:13px; }
.cl-banner { background:#EEF2FF; border-radius:12px; padding:16px; }
.cl-btn-link { display:inline-block; background:#4F46E5; color:#fff; text-decoration:none; border-radius:10px; padding:10px 16px; font-weight:600; }
.cl-btn-link.is-off { background:#E5E7EB; color:#6B7280; cursor:default; }
.cl-spoiler { margin-bottom:8px; border:0; border-radius:0; padding:8px 0; }
.cl-whiteboard-ph { background: var(--cl-accent-soft, #F3F4F6); border-radius:12px; padding:24px; text-align:center; color: var(--cl-accent, #4F46E5); }
.cl-compare { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.cl-spacer-sm { height:12px; } .cl-spacer-md { height:28px; } .cl-spacer-lg { height:48px; }
video.cl-media { aspect-ratio: 16 / 9; width:100%; }
.cl-divider { border:none; border-top:1px solid #E5E7EB; margin:12px 0; }
.cl-divider-dots { border:none; height:8px; margin:16px 0; background:radial-gradient(circle, #D1D5DB 2px, transparent 2.5px) 0 50% / 16px 8px repeat-x; }
.cl-divider-space { border:none; height:28px; margin:0; background:none; }
.cl-quiz-head { font-size:14px; color: var(--cl-ink, #111); background: var(--cl-accent-soft, #EEF2FF); border-radius:10px; padding:12px 14px; margin-bottom:12px; font-weight:600; }
.cl-book { background:#F8FAFC; border-radius:12px; padding:12px 14px; }
.cl-book-kicker { font-size:12px; font-weight:700; color: var(--cl-accent, #4F46E5); letter-spacing:.08em; text-transform:uppercase; margin-bottom:4px; }
.cl-vr-hint { font-size:14px; color: var(--cl-accent, #4F46E5); margin:8px 0 0; font-weight:600; }
.cl-hw-meta, .cl-hw-hint { font-size:12px; color:#92400E; margin:0 0 8px; }
.cl-hw-ok { font-size:13px; color:#065F46; }
.cl-hw-wait { font-size:13px; color:#92400E; }
.cl-hw-rev { font-size:13px; color:#991B1B; background:#FEE2E2; border-radius:10px; padding:8px 12px; margin-bottom:10px; }
.cl-hw-comment { font-size:13px; color:#374151; margin-top:6px; }
.cl-hw-rec { border:1px solid #F59E0B; background:#FFFBEB; color:#92400E; border-radius:999px; padding:8px 14px; font-size:13px; font-weight:600; cursor:pointer; }
.cl-hw-rec.recording { background:#FEE2E2; border-color:#EF4444; color:#991B1B; }
.lb-repeat-row { display:flex; gap:6px; align-items:flex-start; margin-bottom:6px; }
.lb-repeat-row > .lb-input, .lb-repeat-row > .lb-field, .lb-repeat-row > .lb-media-slot { flex:1; min-width:0; }
.lb-compare-slots { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.lb-compare-slot .lb-label { margin-bottom:6px; }
.lb-media-slot .lb-upload-menu { margin-top:8px; }
@media (max-width: 640px) {
  .lb-compare-slots { grid-template-columns:1fr; }
}
.lb-repeat-del { width:32px; height:32px; border:1px solid #E5E7EB; background:#fff; border-radius:8px; cursor:pointer; color:#6B7280; flex-shrink:0; font-size:16px; line-height:1; }
.lb-repeat-add { margin-top:4px; }

.lb-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 95;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 16px 32px;
  box-sizing: border-box;
}
.lb-modal.is-open { display: flex; }
.lb-modal-backdrop { position: absolute; inset: 0; background: rgba(17,24,39,.28); }
.lb-modal-dialog {
  position: relative;
  width: min(440px, 100%);
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--lb-line);
}
.lb-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 4px;
  flex-shrink: 0;
  background: #fff;
}
.lb-modal-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--lb-ink);
}
.lb-modal-close {
  width: 32px; height: 32px; border: none; background: transparent;
  border-radius: 8px; cursor: pointer; color: var(--lb-muted);
  font-size: 22px; line-height: 1; padding: 0;
}
.lb-modal-close:hover { background: #F9FAFB; color: var(--lb-ink); }
.lb-modal-body { padding: 8px 20px 22px; overflow: auto; flex: 1 1 auto; }
.lb-modal-foot {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--lb-line);
  background: #fff;
}
.lb-modal-kicker {
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--lb-muted);
  margin: 16px 0 2px;
}
.lb-modal-kicker:first-child { margin-top: 8px; }
.lb-photo-mock,
.lb-role-mock {
  border: 1px dashed var(--lb-line);
  border-radius: 10px;
  padding: 22px 16px;
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
  color: var(--lb-muted);
  background: #FAFAF8;
  margin: 0 0 12px;
}
.lb-settings-rows { margin: 0 0 8px; }
.lb-settings-rows .nt-row { padding-left: 0; padding-right: 0; }
.lb-modal .nt-row { padding-left: 0; padding-right: 0; }
.lb-rev-list { list-style: none; margin: 0; padding: 0; }
.lb-rev-list li {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--lb-line);
}
.lb-rev-list li:last-child { border-bottom: none; }
.lb-rev-list span { font-size: 13px; color: var(--lb-ink); }
.lb-rev-list button { margin: 0; }
.lb-modal-danger { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--lb-line); display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.lb-btn-danger { background: #FEE2E2; color: #991B1B; }

.lb-media-current {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.lb-media-current-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-media-current .lb-btn {
  flex-shrink: 0;
  padding: 6px 12px;
}

.lb-upload-menu {
  margin-top: 8px;
  width: 100%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}
.lb-upload-menu > * + * {
  border-top: 1px solid #e5e7eb;
}
.lb-upload-menu .lb-media-form {
  margin: 0;
  display: block;
}
.lb-upload-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 10px 14px;
  border: none;
  border-radius: 0;
  background: #fff;
  color: #374151;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}
.lb-upload-item:hover {
  background: #f9fafb;
}
.lb-upload-item input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  padding: 0;
  border: 0;
}
