/* Library thumbnails from ingested sources */
.thumb.has-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb.has-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35), transparent 35%, transparent 55%, rgba(0,0,0,.7)); }
.thumb.has-img > div { position: relative; z-index: 1; }
.thumb-link { text-decoration: none; display: block; }

/* Sources admin */
.src-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.q-row { display: grid; grid-template-columns: 90px 110px 1fr auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
@media (max-width: 640px) { .q-row { grid-template-columns: 1fr 1fr; } }

/* Sidebar workspace switcher */
.nav-sep { height: 1px; background: var(--line); margin: 8px 6px; }
.side-nav { overflow-y: auto; }
#ws-switcher { position: relative; }
.ws-current { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; text-align: left; }
.ws-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-badge { width: 22px; height: 22px; border-radius: 6px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-size: 12px; flex: none; }
.ws-menu { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 10px; display: grid; gap: 4px; z-index: 60; }
.ws-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; border: 0; background: transparent; cursor: pointer; text-align: left; }
.ws-item:hover, .ws-item.active { background: var(--surface-2); }
.ws-new { display: flex; gap: 6px; margin-top: 6px; }
.ws-new .input { padding: 6px 8px; font-size: 13px; }

/* Assistant */
.assist-fab { position: fixed; right: 20px; bottom: 20px; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 22px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); z-index: 70; }
.assist-panel { position: fixed; right: 20px; bottom: 84px; width: min(380px, calc(100vw - 32px)); max-height: 70vh; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 14px; display: grid; gap: 10px; grid-template-rows: auto 1fr auto; z-index: 70; }
.assist-log { overflow-y: auto; display: grid; gap: 8px; align-content: start; min-height: 120px; max-height: 45vh; }
.assist-msg { padding: 9px 12px; border-radius: 12px; font-size: 14px; max-width: 90%; display: grid; gap: 4px; }
.assist-msg.bot { background: var(--surface-2); }
.assist-msg.me { background: var(--ink); color: var(--bg); justify-self: end; }
.assist-panel form .input { flex: 1; min-width: 0; }

/* Home */
.home-hero h1 { font-size: clamp(30px, 5vw, 44px); letter-spacing: -0.035em; text-align: center; margin: 12px 0 24px; }
.quickstart { max-width: 560px; margin: 0 auto; display: grid; gap: 14px; }
.qs-list { display: grid; gap: 8px; }
.qs-step { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.qs-step:hover { border-color: var(--ink-3); }
.qs-step.done span:nth-child(2) { text-decoration: line-through; color: var(--ink-3); }
.qs-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 12px; color: var(--good); }
.qs-step.done .qs-check { border-color: var(--good); background: var(--good-soft); }

/* Blitz settings */
.mix-row { display: grid; grid-template-columns: 130px 1fr 48px auto; gap: 10px; align-items: center; font-size: 14px; }
.mix-row input[type=range] { width: 100%; accent-color: var(--accent); }

/* Automations + create */
.auto-card { text-decoration: none; display: grid; gap: 8px; }
.auto-card:hover { border-color: var(--ink-3); }
.chip-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; cursor: pointer; }
.format-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.format-card { text-align: left; cursor: pointer; display: grid; gap: 8px; align-content: start; font: inherit; color: inherit; }
.format-card:hover { border-color: var(--accent); }
.format-card .pill { justify-self: start; }
.format-card.loading { opacity: .6; pointer-events: none; }

/* Library media bank */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.media-card { display: grid; gap: 8px; padding: 12px; min-width: 0; align-content: start; }
.media-card > * { min-width: 0; }
.media-card > .pill { justify-self: start; }
.media-card img, .media-card video { width: 100%; aspect-ratio: 9/12; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.media-card .media-title { flex-wrap: nowrap; align-items: flex-start; }
.media-card .media-title > .pill { flex-shrink: 0; }
.media-card .media-actions { flex-wrap: wrap; gap: 6px; }
/* Topic names are long: wrap to two lines, then ellipsis. */
.media-card .t { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
.narrow { max-width: 640px; }
.faq-card details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq-card details:last-child { border-bottom: 0; }
.faq-card summary { cursor: pointer; font-weight: 600; }
.faq-card p { margin: 10px 0 0; }
.remixed-from { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; margin-bottom: 10px; font-size: 14px; }
.slides-input { min-height: 140px; font-family: var(--mono); font-size: 13px; }
.danger { color: var(--bad); } .danger-card { border-color: var(--bad-soft); }
