/* small extras — Tailwind handles most styling */
input[type="range"] { accent-color: #6366f1; }
input::placeholder { color: #94a3b8; opacity: 1; }
canvas { image-rendering: auto; }
code { background: #1e293b; padding: 1px 5px; border-radius: 6px; }
#dropzone.dragover { border-color: #2dd4bf; background: #042f2e; }

/* ---- 404 page: big brand icon linking back to the homepage ---- */
.home-mark { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin: 0 auto; border-radius: 18px; background: #0d9488; color: #fff; font-size: 28px; font-weight: 700; line-height: 1; text-decoration: none; transition: background 120ms ease; }
.home-mark:hover { background: #14b8a6; }
.home-mark:focus-visible { outline: 2px solid #5eead4; outline-offset: 3px; }

/* ---- simple video editor (editor.html) ---- */
/* Two-column studio layout on desktop (kept here so tw.css needs no rebuild). */
@media (min-width: 1024px) {
  .ed-grid { grid-template-columns: 1fr 1.6fr; }
}
#libDrop.dragover, #tlDrop.dragover { border-color: #2dd4bf; background: #042f2e; }
/* Keep the export decoder in the layout/paint tree (display:none can drop the
 * decoder) but completely out of the page's visual and pointer area. */
.ed-offscreen { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.lib-item { display: flex; align-items: center; gap: 8px; background: #0f172a; border: 1px solid #1e293b; border-radius: 12px; padding: 8px 10px; }
.lib-item .lib-meta { min-width: 0; flex: 1; }
.lib-item .lib-name { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-item .lib-sub { display: block; font-size: 11px; color: #94a3b8; }
.lib-item .lib-actions { display: flex; gap: 4px; flex-shrink: 0; }
.lib-item .lib-actions button { width: 28px; height: 28px; border-radius: 8px; background: #1e293b; font-size: 14px; line-height: 1; }
.lib-item .lib-actions button:hover { background: #334155; }

/* The standby preview element stays rendered (so it keeps buffering and can
 * present its first frame immediately) but is fully transparent. */
.ed-idle { opacity: 0.001; pointer-events: none; }
.tl-scroll { overflow-x: auto; padding-bottom: 4px; contain: layout paint; }
/* Wrapper exists so the playhead can live inside the scrollable area and line up
 * with the blocks (a percentage of the viewport stopped matching them once
 * blocks got a minimum width and a variable zoom). */
.tl-inner { position: relative; display: block; width: max-content; min-width: 100%; }
.tl-track { display: flex; align-items: stretch; gap: 6px; min-height: 96px; padding: 4px 2px; }
.tl-arrow { align-self: center; color: #475569; flex-shrink: 0; }
.tl-clip { position: relative; flex-shrink: 0; display: flex; align-items: stretch; background: #0f172a; border: 1px solid #1e293b; border-radius: 12px; padding: 8px 22px; min-height: 88px; cursor: pointer; user-select: none; }
.tl-clip:hover { border-color: #334155; }
.tl-clip.tl-active { border-color: #a855f7; box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.55); }
.tl-clip.tl-selected { border-color: #64748b; }
.tl-clip.tl-trimming { border-color: #e2e8f0; box-shadow: 0 0 0 2px rgba(226, 232, 240, 0.6); }
.tl-body { min-width: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.tl-head { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Duration is the one number that must stay readable at any block width. */
.tl-dur { display: block; font-size: 13px; font-weight: 700; color: #e2e8f0; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.tl-sub { display: block; font-size: 11px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Narrow / heavily trimmed blocks: keep name + duration, drop the third line. */
.tl-clip.tl-compact .tl-sub { display: none; }
.tl-handle { position: absolute; top: 0; bottom: 0; width: 22px; display: flex; align-items: center; justify-content: center; background: rgba(148, 163, 184, 0.15); color: #e2e8f0; font-size: 11px; cursor: ew-resize; touch-action: none; }
.tl-handle:hover { background: rgba(148, 163, 184, 0.35); }
.tl-handle-l { left: 0; border-radius: 12px 0 0 12px; }
.tl-handle-r { right: 0; border-radius: 0 12px 12px 0; }
.tl-handle-off { opacity: 0.3; cursor: default; }
.tl-x { position: absolute; top: 4px; right: 26px; width: 20px; height: 20px; border-radius: 6px; background: #1e293b; color: #94a3b8; font-size: 12px; line-height: 1; display: none; }
.tl-clip:hover .tl-x { display: block; }
.tl-x:hover { background: #7f1d1d; color: #fff; }
.tl-needle { position: absolute; left: 0; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #ef4444; pointer-events: none; will-change: transform; transition: none; }

/* ---- timeline zoom control ---- */
.tl-zoom { display: flex; align-items: center; gap: 6px; background: #0f172a; border: 1px solid #1e293b; border-radius: 10px; padding: 3px 8px; }
.tl-zoom-label { font-size: 11px; color: #94a3b8; }
.tl-zoom-btn { width: 22px; height: 22px; border-radius: 6px; background: #1e293b; color: #e2e8f0; font-size: 13px; line-height: 1; cursor: pointer; }
.tl-zoom-btn:hover:not(:disabled) { background: #334155; }
.tl-zoom-btn:disabled { opacity: 0.3; cursor: default; }
.tl-zoom-fit { width: auto; padding: 0 6px; font-size: 11px; font-weight: 600; }
.tl-zoom-val { font-size: 11px; color: #94a3b8; font-variant-numeric: tabular-nums; min-width: 46px; text-align: right; }
.tl-zoom-range { width: 96px; cursor: pointer; }
