/* ========== Asset detail ========== */
.asset-detail {
  display: flex; flex-direction: column;
  flex: 1;        /* parent is `.main` (flex col) - fill remaining vertical space */
  min-height: 0;
  background: var(--bg-0);
  overflow: hidden;
}
.asset-detail-header {
  height: var(--topbar-h);
  display: flex; align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.asset-detail-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 320px;
  overflow: hidden;
  min-height: 0;
}
.player-col {
  display: flex; flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--border);
}
.comment-composer-col {
  background: var(--bg-1);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.player {
  background: #000;
  padding: 16px;
  display: flex; flex-direction: column;
  gap: 8px;
}
.player-canvas {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #050608;
  max-height: 52vh;
}
.player-canvas .thumb-svg { width: 100%; height: 100%; display: block; }
.player-play-overlay {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.4));
  transition: background 120ms;
}
.player-play-overlay:hover { background: rgba(0,0,0,0.3); }
.player-play-overlay svg {
  width: 64px; height: 64px;
  color: white;
  background: rgba(0,0,0,0.55);
  border-radius: 50%;
  padding: 16px;
}
.player-tc {
  position: absolute;
  right: 12px; bottom: 12px;
  background: rgba(0,0,0,0.6);
  padding: 4px 10px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: white;
}
.player-overlay-markers {
  position: absolute; inset: 16px;
  pointer-events: none;
}
.player-pin {
  position: absolute;
  left: 30%; top: 40%;
  display: flex; align-items: center; gap: 6px;
  pointer-events: auto;
}
.player-pin-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600; color: white;
  border: 2px solid white;
}
.player-pin-bubble {
  background: var(--accent);
  color: white;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  max-width: 240px;
}

.player-controls {
  display: flex; align-items: center; gap: 8px;
  padding: 0 4px;
}

.playback-bar {
  flex: 1;
  height: 24px;
  position: relative;
  cursor: pointer;
  display: flex; align-items: center;
}
.playback-bar::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
}
.playback-fill {
  position: absolute;
  height: 4px;
  background: var(--accent);
  border-radius: 99px;
  pointer-events: none;
}
.playback-handle {
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: white;
  transform: translateX(-50%);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.2);
  pointer-events: none;
}
.playback-marker {
  position: absolute;
  transform: translateX(-50%) translateY(-2px);
  z-index: 2;
}
.marker-avatar {
  display: grid; place-items: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 9px; font-weight: 600;
  border: 1.5px solid var(--bg-0);
}
.playback-marker.resolved .marker-avatar { background: var(--text-4); opacity: 0.5; }

.filmstrip-wrap {
  background: var(--bg-1);
  border-radius: var(--r-sm);
  padding: 8px;
  margin-top: 4px;
}
.filmstrip {
  position: relative;
  display: flex;
  gap: 1px;
  height: 48px;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
}
.film-frame {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.film-frame .thumb-svg { width: 100%; height: 100%; }
.filmstrip-playhead {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 0 6px var(--accent);
}
.filmstrip-playhead::before {
  content: "";
  position: absolute;
  top: -4px; left: 50%;
  transform: translateX(-50%);
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 2px;
  transform: translateX(-50%) rotate(45deg);
}
.filmstrip-pin {
  position: absolute;
  bottom: -6px;
  transform: translateX(-50%);
}
.filmstrip-pin-avatar {
  display: grid; place-items: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 8px;
  font-weight: 600;
  border: 1.5px solid var(--bg-1);
}
.filmstrip-pin.resolved .filmstrip-pin-avatar { background: var(--text-4); }
.filmstrip-tc {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  padding: 0 2px;
  font-size: 10px;
  color: var(--text-4);
}

.asset-detail-tabs {
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 40px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  gap: 4px;
  background: var(--bg-0);
  flex-shrink: 0;
}
.asset-detail-tabs button {
  height: 40px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-3);
  position: relative;
  display: flex; align-items: center; gap: 6px;
}
.asset-detail-tabs button:hover { color: var(--text-1); }
.asset-detail-tabs button.active { color: var(--text-1); }
.asset-detail-tabs button.active::after {
  content: ""; position: absolute;
  bottom: -1px; left: 8px; right: 8px;
  height: 2px; background: var(--accent);
}
.asset-detail-tabs .count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: var(--bg-3);
  padding: 0 6px;
  border-radius: 99px;
  color: var(--text-3);
}
.asset-detail-tabs button.active .count { background: var(--accent-soft); color: var(--accent-text); }
.tiny-toggle {
  display: flex; align-items: center; gap: 5px;
  font-size: 11.5px;
  color: var(--text-3);
  cursor: pointer;
}
.tiny-toggle input { accent-color: var(--accent); }

.asset-detail-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px 20px;
}

.comments-list { display: flex; flex-direction: column; gap: 4px; }
.comment {
  display: flex; gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.comment.resolved { opacity: 0.55; }
.comment-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 10.5px;
  font-weight: 600;
  color: white;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.comment-body { flex: 1; min-width: 0; }
.comment-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
}
.comment-who { font-weight: 600; }
.comment-time {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--accent-soft);
  color: var(--accent-text);
  padding: 1px 6px;
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  cursor: pointer;
}
.comment-time:hover { background: var(--accent-soft-2); }
.comment-when { color: var(--text-3); font-size: 11px; }
.comment-action { color: var(--text-3); }
.comment-action:hover { color: var(--text-1); }
.comment-text {
  font-size: 12.5px;
  color: var(--text-1);
  margin-top: 4px;
  line-height: 1.5;
}
.comment-resolved {
  font-size: 11px;
  color: var(--success);
  margin-top: 4px;
}

.comment-composer {
  padding: 16px;
  display: flex; flex-direction: column;
  gap: 10px;
  height: 100%;
}
.composer-head {
  display: flex; align-items: center; justify-content: space-between;
}
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -6px; border: 2px solid var(--bg-1); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.add-reviewer {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1.5px dashed var(--border-stronger);
  display: grid; place-items: center;
  color: var(--text-3);
  margin-left: -2px;
}
.composer-tag {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px;
}
.composer-input {
  width: 100%;
  min-height: 90px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  outline: 0;
  font-size: 13px;
  resize: vertical;
  color: var(--text-1);
}
.composer-input:focus { border-color: var(--accent); }
.composer-bar {
  display: flex; align-items: center; gap: 8px;
}
.composer-tools { display: flex; gap: 2px; }

.versions-list { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; }
.version-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-1);
}
.version-thumb {
  width: 120px; aspect-ratio: 16/9;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-2);
}

.meta-table {
  display: flex; flex-direction: column;
  padding: 8px 0;
}
.meta-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  gap: 16px;
}
.meta-row .meta-k { color: var(--text-3); }
.meta-row .meta-v { font-family: var(--font-mono); font-size: 12px; word-break: break-all; }

/* ========== Audio tab ========== */
.audio-tab {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 0;
}

.audio-tracks {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.audio-track {
  display: grid;
  grid-template-columns: 140px 1fr 64px auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: opacity 120ms;
}

.audio-track.muted {
  opacity: 0.4;
}

.audio-track-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.audio-track-waveform {
  min-width: 0;
  overflow: hidden;
  height: 32px;
}

.audio-track-waveform .waveform {
  width: 100%;
  height: 32px;
  display: block;
}

.audio-track-meters {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.audio-track-meta {
  display: flex;
  gap: 8px;
  font-size: 10.5px;
  color: var(--text-3);
  white-space: nowrap;
}

.audio-track-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.audio-btn {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-3);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 80ms, color 80ms, border-color 80ms;
}

.audio-btn:hover {
  border-color: var(--border-stronger);
  color: var(--text-1);
}

.audio-btn.mute.active {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.audio-btn.solo.active {
  background: var(--warning);
  color: var(--bg-0);
  border-color: var(--warning);
}

.audio-fader {
  display: flex;
  align-items: center;
  gap: 4px;
}

.audio-fader input[type="range"] {
  width: 60px;
  height: 4px;
  appearance: none;
  background: var(--bg-3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.audio-fader input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-1);
  border: 1px solid var(--border-strong);
  cursor: pointer;
}

.audio-fader input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-1);
  border: 1px solid var(--border-strong);
  cursor: pointer;
}

.audio-fader .mono {
  font-size: 10px;
  color: var(--text-4);
  min-width: 24px;
  text-align: right;
}

.audio-master {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.audio-master-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  min-width: 48px;
}

.audio-master-meters {
  display: flex;
  gap: 6px;
}

.master-fader input[type="range"] {
  width: 100px;
}

/* Audio level meters */
.audio-level-meter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.audio-level-bar {
  display: flex;
  flex-direction: column-reverse;
  gap: 1px;
  width: 10px;
}

.audio-level-seg {
  width: 10px;
  height: 3px;
  border-radius: 1px;
  transition: background 60ms;
}

.audio-level-label {
  font-size: 9px;
  color: var(--text-4);
  text-align: center;
}

/* Responsive: stack on narrow screens */
@media (max-width: 900px) {
  .audio-track {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px;
  }
  .audio-track-waveform { height: 24px; }
  .audio-track-meters { justify-content: flex-start; }
}
