/* Course builder + media library */
.cb-head { display: flex; align-items: center; gap: 10px; width: 100%; flex-wrap: wrap; }
.cb-title { flex: 1; min-width: 220px; font-family: var(--serif); font-size: 28px; border: 1px solid transparent; background: transparent; border-radius: 12px; padding: 6px 10px; color: var(--ink); }
.cb-title:hover { border-color: var(--line); background: #fff; }
.cb-title:focus { outline: none; border-color: var(--green-2); background: #fff; }
.cb-status { width: auto; padding: 8px 12px; font-weight: 700; }
#saveBtn.pulse { box-shadow: 0 0 0 0 rgba(44,90,65,.5); animation: savepulse 1.8s infinite; }
@keyframes savepulse { 70% { box-shadow: 0 0 0 10px rgba(44,90,65,0); } }
.cb-wrap { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 18px; align-items: start; }
.cb-outline { position: sticky; top: 16px; max-height: calc(100dvh - 140px); overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 14px; display: grid; gap: 10px; }
.cb-stats { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12.5px; color: var(--muted); padding: 4px 4px 8px; border-bottom: 1px solid var(--line-2); }
.cb-stats b { color: var(--ink); }
.cb-stats .warn b { color: var(--saffron); }
.cb-m { background: #fcf8f0; border: 1px solid var(--line-2); border-radius: 14px; padding: 6px; }
.cb-mh { display: flex; align-items: center; gap: 4px; cursor: grab; }
.cb-min { flex: 1; min-width: 0; border: 1px solid transparent; background: transparent; font-weight: 800; font-size: 14px; padding: 6px 6px; border-radius: 8px; }
.cb-min:focus { outline: none; border-color: var(--green-2); background: #fff; }
.grip { width: 16px !important; height: 16px !important; color: #c5b79c; flex: none; cursor: grab; }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 9px; }
.cb-ls { display: grid; gap: 2px; min-height: 8px; border-radius: 10px; padding: 2px 0; }
.cb-ls.over { background: var(--green-soft); }
.cb-l { display: flex; align-items: center; gap: 7px; width: 100%; text-align: left; border: 1px solid transparent; background: #fff; border-radius: 10px; padding: 8px 8px; cursor: pointer; font: inherit; font-size: 13.5px; color: inherit; position: relative; }
.cb-l:hover { border-color: var(--line); }
.cb-l.on { border-color: var(--green-2); background: var(--green-soft); }
.cb-l .t { width: 15px; height: 15px; color: var(--muted); flex: none; }
.cb-lt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cb-l .badge { font-size: 10.5px; padding: 1px 7px; }
.cb-l .ok { color: var(--green-2); } .cb-l .miss { color: #d8b07a; }
.cb-l .ok .lucide, .cb-l .miss .lucide { width: 15px; height: 15px; }
.cb-l.dragging { opacity: .4; }
.cb-l.drop-before { box-shadow: 0 -2px 0 var(--saffron); }
.cb-l.drop-after { box-shadow: 0 2px 0 var(--saffron); }
.cb-add { display: flex; gap: 6px; align-items: center; width: 100%; border: 0; background: none; color: var(--green-2); font-weight: 700; font-size: 13px; padding: 8px; cursor: pointer; border-radius: 8px; }
.cb-add:hover { background: #fff; }
.cb-add .lucide { width: 15px; height: 15px; }
.cb-editor { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 22px; min-width: 0; }
.ed-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.ed-nav { display: flex; gap: 4px; }
.ed-title { width: 100%; font-family: var(--serif); font-size: 26px; border: 1px solid transparent; border-radius: 12px; padding: 6px 8px; margin: 0 -8px 12px; background: transparent; }
.ed-title:hover { border-color: var(--line); }
.ed-title:focus { outline: none; border-color: var(--green-2); background: #fff; }
.ed-types { margin-bottom: 16px; }
.vid-card { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: 18px; align-items: start; background: #fcf8f0; border: 1px solid var(--line-2); border-radius: 16px; padding: 12px; }
.vid-thumb, .lib-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #1c2a21; border: 0; padding: 0; cursor: pointer; display: grid; place-items: center; color: #9fb3a5; width: 100%; }
.vid-thumb img, .lib-thumb img { width: 100%; height: 100%; object-fit: cover; }
.vid-thumb em, .lib-thumb em { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.72); color: #fff; font: 700 11.5px var(--sans); padding: 2px 7px; border-radius: 6px; font-style: normal; }
.lib-play { position: absolute; width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--green); display: grid; place-items: center; opacity: .9; transition: transform .2s var(--ease); }
.vid-thumb:hover .lib-play, .lib-thumb:hover .lib-play { transform: scale(1.1); }
.lib-play .lucide { margin-left: 3px; }
.vid-info { display: grid; gap: 6px; align-content: start; min-width: 0; }
.vid-act { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.vid-empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 34px 16px; border: 2px dashed #d7c9ae; border-radius: 16px; background: #fffdf8; }
.vid-empty > .lucide { width: 34px; height: 34px; color: var(--green-2); }
.res-box { margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.res-file { display: flex; gap: 12px; align-items: center; }
.ed-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.lib-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; }
.lib-thumb { border-radius: 0; }
.lib-thumb.pdf { background: var(--rose-soft); color: var(--rose); }
.lib-thumb.pdf .lucide { width: 40px; height: 40px; }
.lib-b { padding: 12px 14px 14px; display: grid; gap: 4px; flex: 1; align-content: start; }
.lib-title { font-weight: 800; font-size: 15px; border: 1px solid transparent; border-radius: 8px; padding: 4px 6px; margin: 0 -6px; background: transparent; }
.lib-title:hover, .lib-title:focus { border-color: var(--line); background: #fff; outline: none; }
.lib-act { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
@media (max-width: 1100px) { .cb-wrap { grid-template-columns: 1fr; } .cb-outline { position: static; max-height: none; } }
@media (max-width: 700px) { .vid-card { grid-template-columns: 1fr; } .cb-title { font-size: 22px; min-width: 0; flex: 1 1 100%; order: -1; } .cb-editor { padding: 16px; } .ed-types { width: 100%; } }
